define(['core/boilerplate'],
	function(Boilerplate) {
		var Tile = function() {

			this.name = "Tile";

			this.init = function(TileManager, TileConf) {
				// Initialize Tile
				this.configure(TileConf.def);

				// Set texture
				if(randi(0, 100) > 75) {
					this.texture = TileConf.textures[5];
				} else {
					this.texture = TileConf.textures[0];
				}
			}
		}

		Tile.prototype = {
			update : function() {
				// Update Tile objects
				this.render();
			},
			render : function() {
				// Render Tile
				drawRect(
					Boilerplate.scene.ctx,
					this.texture.color,
					this.x,
					this.y,
					this.size,
					this.size
				);
			}
		}

		return Tile;
	}
);